package cn.edu.scau.cmi.lixiaoyuan.client;

import java.util.Scanner;

import cn.edu.scau.cmi.lixiaoyuan.abstractFactory.domainAbstract.Meat;
import cn.edu.scau.cmi.lixiaoyuan.abstractFactory.domainInterface.Wens;
import cn.edu.scau.cmi.lixiaoyuan.abstractFactory.factory.AbstractFactory;
import cn.edu.scau.cmi.lixiaoyuan.abstractFactory.factory.AonongFactory;
import cn.edu.scau.cmi.lixiaoyuan.abstractFactory.factory.TianbangFactory;
import cn.edu.scau.cmi.lixiaoyuan.abstractFactory.factory.WensFactory;

public class AbstractFactoryClient {
     public static void main(String[] args) {
		System.out.println("选择产品品牌：");
		Scanner sc = new Scanner(System.in);
		String brandName = sc.next();
		AbstractFactory factory = null;
		switch(brandName) {
		case "Aonong":
			factory = new AonongFactory();
			break;
		case "Tianbang":
			factory = new TianbangFactory();
			break;
		case "Wens":
			factory = new WensFactory();
			break;
			default:System.out.println("sorry,no such brand");
			
		}
	
		System.out.println("选择肉类：");
		Meat meat = null;
		String meatkind = sc.next();
		switch(meatkind) {
		case "chicken":
			meat = factory.creatChicken();
			break;
		case "pork":
		    meat = factory.creatPork();
		    break;
		case "beef":
			meat = factory.creatBeef();
			break;
		default:System.out.println("no such meat");
		}
		if(meat!=null){
			meat.cook();
		}
			
}
}
